package com.ys.homework;

/**
 * @author CodeYang
 * @Description TODO
 * @Date 2020/12/14 20:15
 */
public class Draw画图06 {
    int count;
    int lines;

    public Draw画图06() {
    }

    public Draw画图06(int count, int lines) {
        this.count = count;
        this.lines = lines;
    }

    /**
     * 画直角三角形
     */
    void drawTrina() {
        for (int i = 0; i < lines; i++) {
            for (int j = 0; j < i; j++) {
                System.out.print("*");
            }
            System.out.println();
        }
    }

    /**
     * 输出矩形
     */
    void drawRec(){
        for (int i = 0; i < lines; i++) {
            for (int j = 0; j < count; j++) {
                System.out.print("*");
            }
            System.out.println();
        }
    }

    /**
     * 输出平行四边形
     */
    void  drawPra(){
        for (int i = 0; i < lines; i++) {
            // 两个内层循环
            for(int k=0;k<i;k++){
                System.out.print(" ");
            }
            for (int j = 0; j < count; j++) {
                System.out.print("*");
            }
            System.out.println();
        }
    }
    public static void main(String[] args) {
        Draw画图06 obj = new Draw画图06(5,5);
        obj.drawTrina();
        obj.drawRec();
        obj.drawPra();


    }
}
